﻿using SharpDepend.WinRT.Renderer;
using SharpDepend.WP8;
using System.Linq;

namespace SharpDepend.WinRT
{
    public static class SpecialDrives
    {
        public const string DocumentMusic = "Music:/";
    }

    public static class Manager
    {
        /// <summary>
        /// Initialize Windows Desktop implementation of SharpDepend classes.
        /// </summary>
        public static void Init()
        {
            // NOTE: WinRT is exteamly sensitive with threads and deadlocks. This must be started with Software
            // and later be rechanged to directX otherwise it will hang the whole application.
            GraphicsDisplayManager graphicsManager = new GraphicsDisplayManager();
            graphicsManager.AddDevice(new GraphicDevice(typeof(SoftwareRenderer), "Software"));
            graphicsManager.AddDevice(new GraphicDevice(typeof(DirectX2DRenderer), "DirectX2D"));
            graphicsManager.AddDevice(new GraphicDevice(typeof(DirectX3DRenderer), "DirectX3D"));

            // Set first graphics device as default.
            graphicsManager.SetGraphicsDevice(graphicsManager.AvailableDevices.ElementAt(0));

            KeyboardManager keyboardManager = new KeyboardManager();

            SharpDepend.Manager.Registrate(
                new ClientManager(),
                null,
                new MulticastManager(),
                new ThreadManager(),
                new AESSecurityManager(),
                new GUITimerManager(),
                new FileManager(),
                null,
                null,
                graphicsManager,
                keyboardManager,
                new CameraManager(),
                new StopwatchManager(),
                new EnviromentStatisticsManager());

            keyboardManager.LazyInit();
        }
    }
}
